.SUFFIXES: .F90 .o

MODULE_OBJECTS=param.o derived.o global.o

FUNCTION_OBJECTS=reallocint.o 

SOURCE_OBJECTS=main.o readinp.o check_param.o make_lattice.o delmem.o set_param.o write_final_info.o \
	       set_near_lattice.o

DATA_FILE=\

FORM_FILE=\

OBJECTS=$(MODULE_OBJECTS) $(FUNCTION_OBJECTS) $(SOURCE_OBJECTS) 
INPUT=inp

FC=gfortran
FFLAGS=-c
SRCS=$(OBJECTS:.o=.F90)
MODULE=$(MODULE_OBJECTS:.o=.mod)
MF=Makefile
TARGET=mtok

%.o : %.mod

.F90.o:
#	$(FC) -c $(FFLAGS) $(SRCS)
	$(FC) $(FFLAGS) $<

$(TARGET): $(OBJECTS)
	$(FC) -o $@ $(OBJECTS)

tar:
#	tar cvf $(TARGET).tar $(MF) $(SRCS)
	tar cvf $(TARGET).tar $(MF) $(SRCS) $(INPUT) # $(DATA_FILE) $(FORM_FILE)

clean:
	rm $(OBJECTS) $(MODULE) $(TARGET)

# Module
param.o : param.F90
derived.o : derived.F90
global.o : global.F90
# Function
reallocint.o : reallocint.F90
# realloc.o : realloc.F90
# Main program
main.o : main.F90
# Subroutine
readinp.o : readinp.F90
check_param.o : check_param.F90
make_lattice.o : make_lattice.F90
delmem.o : delmem.F90
set_param.o : set_param.F90
write_final_info.o : write_final_info.F90
set_near_lattice.o : set_near_lattice.F90